package org.openCage.artig;

import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
import org.openCage.io.fspath.FSPath;
import org.openCage.io.fspath.FSPathBuilder;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class GoMavenSetup implements CmdArgs {

    @Option( name="-v", aliases = {"--verbose"}, usage = "turn on verbose messages")
    private boolean verbose;

    @Option( name="-p", aliases = {"--project"}, metaVar = "DIR", usage = "the project root, (defaults to current dir)")
//    private String dir = "/Users/stephan/tmp/ele";
    private String dir = ".";

    @Argument()
    private List<String> arguments = new ArrayList<String>();
    private FSPath projectDir;


    @Override
    public String getName() {
        return "maven-setup";
    }

    @Override
    public void go() {
        projectDir = FSPathBuilder.getPath( new File(dir).getAbsolutePath());

        ArtigLogic al = new ArtigLogic( projectDir );
        al.init();

        new MavenGen( al ).generate();
//
//        Artig artig = ArtigUtils.readArtig( projectDir );

//        System.out.println("see ant go " + artig );
    }

    @Override
    public String usage() {
        return "";
    }
}

